package org.gruposp2p.openid.provider

import java.util.Date;

class Account {
	
	static belongsTo = [userDNI:UserDNI]
	                    
    static hasMany = [outboundTransactions:Transaction, inboundTransactions:Transaction]
    static mappedBy = [outboundTransactions:"accountFrom", inboundTransactions:"accountTo"]

	//automatically updated for by GORM
	Date dateCreated
	Date lastUpdated
	
	BigDecimal balance
	String type
	String name
	String details
	boolean enabled
	boolean accountExpired
	boolean accountLocked
	
	static constraints = {
		balance nullable: false, scale: 2
	}
	
}
